package Tydzien1;

public class Calculator {

	public int add (int x, int y)
	{
		return x+y;
	}

	public int difference (int x, int y)
	{
		return x-y;
	}
	public int multiply (int x, int y)
	{
		return x*y;
	}
	
	public int divide (int x, int y)
	{
		if(y == 0)
		{
			return (int) Double.NaN;
		}
		else
		{
			return x/y;
		}
	}
	
	public double add (double x, double y)
	{
		return x+y;
	}

	public double difference (double x, double y)
	{
		return x-y;
	}
	
	public double multiply (double x, double y)
	{
		return x*y;
	}

	public double divide (double x, double y)
	{
		return x/y;
	}
}